package concursos.prova;

import concursos.concurso.Concurso;
import concursos.concurso.Evento;
import java.io.Serializable;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="PROVA_TIPO",
    discriminatorType=DiscriminatorType.STRING, length = 15)
@Table(schema="th28841_testes")
public abstract class Prova implements Serializable {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
    private long id;
    private boolean permiteConsulta;

    @ManyToOne
    private Concurso concurso;

    @OneToOne
    @JoinColumn(name="EVENTO_ID", referencedColumnName="ID", updatable=false)
    private Evento realizacao;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public boolean isPermiteConsulta() {
        return permiteConsulta;
    }

    public void setPermiteConsulta(boolean permiteConsulta) {
        this.permiteConsulta = permiteConsulta;
    }

    public Evento getRealizacao() {
        return realizacao;
    }

    public void setRealizacao(Evento realizacao) {
        this.realizacao = realizacao;
    }

    public Concurso getConcurso() {
        return concurso;
    }

    public void setConcurso(Concurso concurso) {
        this.concurso = concurso;
    }

    
}
 
